<?
/*
@ User Area includes: This file decides what to include for files in public area
*/
@include("admin/config/gen_inc.php");
@include("admin/config/opt_inc.php");
@include("admin/config/pay_inc.php");
@include("admin/config/board_inc.php");
if ($set_utf_disable!="1")
	header ("content-type: text/html; charset=utf-8");
	
// Stop searchengines from getting &sid=8hh88 in every url
$lSearchEngineArray=array("Google", "Fast", "Slurp", "Ink", "Atomz", "Scooter", "Crawler", "MSNbot", "Poodle", "Genius"); 
$lIsSearchE=0; 
foreach($lSearchEngineArray as $key => $val)  
	if(strstr($_SERVER['HTTP_USER_AGENT'], $val)) 
		$lIsSearchE++; 
if($lIsSearchE==0) 
	session_start(); 

@include("includes/table_names.php");
@include("includes/inputfilter.php");
@include("tools/phpmailer/class.phpmailer.php");
@include("tools/xajax/xajax.inc.php");
@include("includes/tpl_inc.php");
@include("includes/cache.php");
@include("tools/rapleaf/rapleaf.php");

if (!$set_language)
	$set_language="eng";
if ($_SESSION["usr_lang"]!="")
	$set_language=$_SESSION["usr_lang"];	
	
if (isset($_REQUEST["setlang"]))
{
	$_SESSION["la"] = $_REQUEST["setlang"];
	$domain = ($_SERVER['HTTP_HOST'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false;
	setcookie('class_lang',$_REQUEST["setlang"], time()+60*60*24*365, '/', $domain, false);
}

if (!isset($_SESSION["la"]))
	if ($_COOKIE["class_lang"]!=null)
		$_SESSION["la"]=$_COOKIE["class_lang"];	

if ($_SESSION["la"]!="")
	$set_language=substr($_SESSION["la"],0,3);
else if ($set_language=="")
	$set_language="eng";

//@include("../includes/functions_upload.php"); // Common upload library

if ($set_mysql_host && $set_mysql_user && $set_mysql_base)
{
	if ((!@mysql_connect("$set_mysql_host", "$set_mysql_user", "$set_mysql_pass") OR !@mysql_select_db("$set_mysql_base")) && $override!=1)
	{
		echo "DB conection down";	
	}
	else
		mysql_query("SET NAMES utf8");
}
@include("admin/config/language/". $set_language . "_user.inc"); // Language strings for admin area
@include("admin/language_src/". $set_language . "_system.inc"); // User Language strings for admin area
require("includes/functions.php");
require("includes/functions-fdv.php");
?>